

use "Data\Census w-restrictions.dta", clear

drop if (year == 2010 & fyend <= 630) | (year == 2011 & fyend > 630)

gen County = type_code ==  1
gen Municipality = type_code == 2  
gen Township = type_code == 3
gen special_district = type_code == 4 
gen school_district = type_code ==  5
 
keep id year ltd_iss_all_other ltd_iss_private_purp total_capital_outlays total_interest_on_debt total_taxes total_expenditure type_code total_cash___securities total_rev_own_sources total_current_oper County Municipality Township special_district school_district total_debt_outstanding

replace total_taxes = . if total_taxes < 0
replace ltd_iss_all_other = . if ltd_iss_all_other < 0
replace total_interest_on_debt = . if total_interest_on_debt < 0
replace total_cash = . if total_cash < 0
replace total_rev_own_sources = . if total_rev_own_sources < 0


foreach var in ltd_iss_all_other ltd_iss_private_purp total_capital_outlays total_interest_on_debt total_taxes total_expenditure total_cash___securities total_rev_own_sources total_current_oper total_debt_outstanding {
replace `var' = `var' * 1.55 if year == 1995
replace `var' = `var' * 1.51 if year == 1996
replace `var' = `var' * 1.47 if year == 1997
replace `var' = `var' * 1.45 if year == 1998
replace `var' = `var' * 1.42 if year == 1999
replace `var' = `var' * 1.38 if year == 2000
replace `var' = `var' * 1.33 if year == 2001
replace `var' = `var' * 1.32 if year == 2002
replace `var' = `var' * 1.29 if year == 2003
replace `var' = `var' * 1.26 if year == 2004
replace `var' = `var' * 1.23 if year == 2005
replace `var' = `var' * 1.18 if year == 2006
replace `var' = `var' * 1.15 if year == 2007
replace `var' = `var' * 1.11 if year == 2008
replace `var' = `var' * 1.11 if year == 2009
replace `var' = `var' * 1.08 if year == 2010
replace `var' = `var' * 1.06 if year == 2011
replace `var' = `var' * 1.03 if year == 2012
replace `var' = `var' * 1.01 if year == 2013
replace `var' = `var' * 1.00 if year == 2014
}


foreach var in ltd_iss_all_other ltd_iss_private_purp total_capital_outlays total_interest_on_debt total_taxes total_expenditure total_cash___securities total_rev_own_sources total_current_oper total_debt_outstanding {
replace `var' = `var' / 1000
}

*** Summary Table
outreg2 using "Table 1", replace sum(log) label keep(ltd_iss_all_other total_debt_outstanding total_interest_on_debt total_taxes total_rev_own_sources total_cash___securities total_expend County Municipality Township special_district school_district) eqdrop(N) sortvar(ltd_iss_all_other total_debt_outstanding total_interest_on_debt total_taxes total_rev_own_sources total_cash___securities total_expend County Municipality Township special_district school_district) auto(1)

